<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据代理</title>

    <script type="text/javascript" src="../../js/vue.js"></script>

</head>
<body>

    <script type="text/javascript">
        Vue.config.performance = false;

        let number = 18
        let person = {
            name:"zw",
            sex:'男',
        }

        Object.defineProperty(person,'age',{
           /*  value:18,
            enumerable:true, // 允许属性可以枚举遍历
            writable:true, // 允许修改
            configurable:true // 允许被删除 */
            // 当读取属性是被调用
            get () {
                console.log('查询age属性')
                return number
            },
            set(value){
                console.log('修改了age 属性')
                number = value
            }
        })
        console.log(person);
        console.log(Object.keys(person));

        for(let key in person) {
            console.log('@',person[key])
        }
    </script>
    
</body>
</html>